---
title: "Python HttpClient"
date: 2017-4-23
categories:
- python
tags:
---

<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orge264b83">Python3 Http Client Getting Start</a></li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-orge264b83">
<h2 id="orge264b83">Python3 Http Client Getting Start</h2>
<div class="outline-text-2" id="text-orge264b83">
<p>
import http.client
conn = http.client.HTTPConnection("www.python.org")
</p>
<p>
conn.request("GET", "/index.html") # GET path
</p>
<p>
r1 = conn.getresponse()
print(r1.status, r1.reason)
</p>
<p>
respbody = r1.read()
</p>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2017-4-23</p>
<p class="author">Author: gdme1320</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
